const automator = require('miniprogram-automator')

const miniProgram = automator.launch({
	// cliPath: 'path/to/cli',
	projectPath: '/Users/junyitan/Desktop/doctorwork/iPenguinDoctor_qa/dist',
}).then(async miniProgram => {
	await miniProgram.remote() // 扫码登录连接真机，在真机上执行后续测试脚本

	const page = await miniProgram.currentPage()
	await page.waitFor(500)
	const element = await page.$('#homeScrollview')
	console.log(await element.attribute('class'))
	await element.scrollTo(0, 1000)

	await miniProgram.close()
})
